package com.atguigu.gmall.realtime.function;

import com.atguigu.gmall.realtime.util.IkUtil;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

/**
 * @author Archie
 * @date 2021-10-27 20:58
 * @description
 */
@FunctionHint(output = @DataTypeHint("row<word string>"))
public class IkAnalyzer extends TableFunction<Row> {
	public void eval(String keyword){
		for (String word : IkUtil.split(keyword)) {
			collect(Row.of(word));
		}
	}
}
